package com.time.workbench.efficient.consts;

public class CmdConst {
    /**
     * 签出
     */
    public final static String gitCheckoutTemplate = "git checkout {}";

    /**
     * git clone
     */
    public final static String gitCloneTemplate = "git clone {}";

    /**
     * 拉取git
     */
    public final static String gitPullCodeTemplate = "git pull";

    /**
     * cd
     */
    public final static String cd = "cd {}";

    /**
     * 创建目录
     */
    public final static String mkdirP = "mkdir -p {}";


    /**
     * mv
     */
    public final static String mv = "mv {} {}";

    /**
     * ls
     */
    public final static String ls = "ls {}";

    /**
     * mv -f
     */
    public final static String mvF = "mv -f {} {}";

    /**
     * 查找jar的文件
     */
    public final static String findJar = "find  {}  -name *.jar";

    /**
     * 查找文件
     */
    public final static String find = "find  {}";

    /**
     * 查找指定目录下的文件夹 一层深度
     */
    public final static String findMax1D = " find  {} -maxdepth 1 -type d -name '{}'";

    /**
     * 解压
     */
    public final static String tarUnTarGz = "tar -zxvf {} -C {}";

    /**
     * 修改777权限
     */
    public final static String chmod777 = " chmod 777 {}";


    /**
     * 查看端口占用情况
     */
    public final static String lsofPort = "lsof -i:{}";

    /**
     * 输入到文件
     */
    public final static String echoFile = "echo '{}' >  {}";


    /**
     * 输入到文件
     */
    public final static String cpFile = "cp {} {}";

    /**
     * 查找jar文件 只返回名称 不返回全路径
     */
    public final static String findLastName = "find  {}  -name *.{} |sed 's#.*/##'";

    /**
     * 查找jps进程
     */
    public final static String jps = "jps -l";

    /**
     * 启动jar
     * j 启动jar路径
     * l 启动日志输出路径
     */
    public final static String serverStart = "sh /opt/server.sh start -p=dev  -j={} -l={}";

    /**
     * 获取pid
     */
    public final static String serverGetPid = "sh /opt/server.sh pid -j={} ";

    /**
     * 关闭
     */
    public final static String serverStop = "sh /opt/server.sh stop -j={} ";

    /**
     * tomcat停止
     */
    public final static String tomcatStop = "bash -lc 'sh {}/bin/shutdown.sh'";

    /**
     * tomcat启动
     */
    public final static String tomcatStart = "bash -lc 'sh {}/bin/startup.sh'";

    /**
     * 获取tomcatPid
     */
    public final static String tomcatPid = "cat {}/bin/CATALINA_PID";
    /**
     * 传输文件 端口 本地目录   用户名  ip 远程目录
     */
    public final static String scp = "scp -P {} {} {}@{}:{}";


    /**
     * mvn clean
     */
    public final static String mvnClear = "mvn clean";

    /**
     * mvn install
     */
    public final static String mvnInstall = "mvn install";

    /**
     * mvn package
     */
    public final static String mvnPackage = "mvn package";

    public final static String mvnPackageAm = "mvn clean package {} -am -Dmaven.test.skip=true";


}
